$(function () {
	var id = getQueryString("id");
	vm.getInfo(id);
});

var vm = new Vue({
	el:'#mapp',
	data:{
		title: "社会关注与捐赠",
		bsnGzJz: {},
	},
	methods: {
		saveOrUpdate: function (event) {
			var thisUrl;
			if (StringUtils.isEmpty(vm.bsnGzJz.id)) {
				thisUrl = ajaxServerUrlG("bsnGzJz/save");
			} else {
				thisUrl = ajaxServerUrlG("bsnGzJz/update");
			}
			console.log(thisUrl);
			$.ajax({
				type: "POST",
			    url: thisUrl,
                contentType: "application/json",
			    data: JSON.stringify(vm.bsnGzJz),
			    success: function(r){
			    	if(r.code === 0){
						alert('操作成功');
						vm.bsnGzJz = r.bsnGonggao;
					}else{
						alert(r.msg);
					}
				}
			});
		},
		getInfo: function(id){
			if (StringUtils.isEmpty(id)) return;
			var thisUrl = ajaxServerUrlG("bsnGzJz/info/" + id);
			$.get(thisUrl, function(r){
					if(r.code === 0){
                		vm.bsnGzJz = r.bsnGonggao;
					}else{
						alert(r.msg);
					} 
            });
		}
	}
});